// 如果没有通过拦截器配置域名的话，可以在这里写上完整的URL(加上域名部分)
// let indexUrl = '/ebapi/public_api/index';

// 此处第二个参数vm，就是我们在页面使用的this，你可以通过vm获取vuex等操作，更多内容详见uView对拦截器的介绍部分：
// https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
const install = (Vue, vm) => {
	vm.$u.api = {}

	vm.$u.api.login = (params) => vm.$u.post('/api/lawyer.Lawyer/wxLogin', params);		// 登陆
	
	// IM 相关接口
	vm.$u.api.getIMData = (params) => vm.$u.get('api/lawyer.Order/getImConfig', params);		// 获取IM配置信息
	vm.$u.api.checkTalkConsult = (params) => vm.$u.get('/api/lawyer.Order/checkTalkConsult', params);		// 检测和律师通话的用户的时间信息

	
	// 首页
	vm.$u.api.getPostList = (params = {}) => vm.$u.get('api/lawyer.post/getPostList', params);		// 获取帖子列表 0:就是所有帖子 1：自己的帖子
	vm.$u.api.postCase = (params) => vm.$u.post('/api/lawyer.post/createPost', params);		// 发布帖子
	vm.$u.api.delCase  = (params) => vm.$u.post('api/lawyer.post/delPost', params);		// 删除自己的文章
	vm.$u.api.orderStar = (params) => vm.$u.post('api/lawyer.post/star', params);		// 点赞文章/取消点赞文章
	vm.$u.api.getCaseItem = (params) => vm.$u.get('api/lawyer.post/getPost', params);		// 获取一篇帖子
	vm.$u.api.getCommentList = (params) => vm.$u.get('api/lawyer.post/getComment', params);		// 获取一篇文章的评论列表
	vm.$u.api.commentCase = (params) => vm.$u.post('api/lawyer.post/createComment', params);		// 评论一篇文章
	// 问答咨询
	vm.$u.api.getHomeRightList = (params = {}) => vm.$u.get('api/lawyer.Userpost/getPostList', params);		// 获取问答咨询帖子列表
	vm.$u.api.getHomeRightItem = (params) => vm.$u.get('api/lawyer.Userpost/getPost', params);		// 获取一篇帖子
	vm.$u.api.homeRightOrderStar = (params = {}) => vm.$u.post('api/lawyer.Userpost/star', params);		// 点赞文章/取消点赞文章
	vm.$u.api.getHomeRightItemComment = (params = {}) => vm.$u.get('api/lawyer.Userpost/getComment', params);		// 获取一篇文章的评论列表
	vm.$u.api.setHomeRightItemComment = (params) => vm.$u.post('api/lawyer.Userpost/createComment', params);		// 评论一篇文章
	
	// 接单大厅
	vm.$u.api.getcaseTypeList = (params = {}) => vm.$u.get('api/common/getLawyerTypeInfo', params); // 获取案件类型
	vm.$u.api.getcaseDataList = (params = {}) => vm.$u.get('api/lawyer.Order/getLawsuitList', params); // 获取官司订单列表
	vm.$u.api.getcaseItemDetail = (params = {}) => vm.$u.get('api/lawyer.Order/getLawsuitDetail', params); // 查看官司订单详情
	vm.$u.api.receiveOrder = (params) => vm.$u.post('api/lawyer.Order/receiveOrder', params); // 官司订单律师接单
	vm.$u.api.cancelOrderItem = (params) => vm.$u.post('api/lawyer.Order/cancelLawsuitOrder', params); // 律师取消订单，只有status=2的才行

	// 个人中心
	vm.$u.api.getRegionData = (params = {}) => vm.$u.get('api/Common/getArea', params); // 获取省市联动数据
	vm.$u.api.getEducation = (params = {}) => vm.$u.get('api/Common/getEducation', params); // 获取学历信息
	vm.$u.api.setLawyerItem = (params) => vm.$u.post('api/lawyer.lawyer/createApply', params); // 律师入驻申请
	vm.$u.api.getLawyerItemResult = (params) => vm.$u.post('api/lawyer.lawyer/getApply', params); // 获取上一次律师入驻审核结果
	vm.$u.api.aboutUs = (params = {}) => vm.$u.get('/api/common/aboutUs', params); // 关于我们
	// 我的参与
	vm.$u.api.getMyLawyerParticipation = (params = {}) => vm.$u.get('api/lawyer.post/getMyLawyerParticipation', params); // 律师-我的参与-律师圈
	vm.$u.api.getMyParticipation = (params = {}) => vm.$u.get('api/lawyer.post/getMyParticipation', params); // 律师-我的参与-法律天地
	// 我的点赞
	vm.$u.api.getMyLawyerStar = (params = {}) => vm.$u.get('api/lawyer.post/getMyLawyerStar', params); // 律师-我的点赞-律师圈
	vm.$u.api.getMyStar = (params = {}) => vm.$u.get('api/lawyer.post/getMyStar', params); // 律师-我的点赞-法律天地
	
	vm.$u.api.getServiceDatas = (params = {}) => vm.$u.get('api/common/contactUs', params); // 联系平台客服
	// 我的订单
	vm.$u.api.getLawyerServiceList = (params = {}) => vm.$u.get('api/lawyer.Order/getLawyerServiceOrderList', params); // 获取面对面|上门服务订单列表
	vm.$u.api.getLawsuitList = (params = {}) => vm.$u.get('api/lawyer.Order/getLawsuitList', params); // 获取官司订单列表
	vm.$u.api.getTalkOrderList = (params = {}) => vm.$u.get('api/lawyer.Order/getTalkOrderList', params); // 获取图文咨询订单
	vm.$u.api.confirmOrderItem = (params) => vm.$u.post('api/lawyer.Order/confirmLawyerServiceOrder', params); // 律师确认上门|面对面服务订单
	vm.$u.api.getLawyerService = (params = {}) => vm.$u.get('api/lawyer.Order/getLawyerService', params); // 获取一个面对面|上门服务订单状态详情等数据
	vm.$u.api.conformLawsuitOrder = (params = {}) => vm.$u.post('api/lawyer.Order/conformLawsuitOrder', params); // 律师确认完成官司订单，status等于2才行
	vm.$u.api.getMyCommentList = (params = {}) => vm.$u.get('api/lawyer.Lawyer/getLawyerComment', params); // 获取用户对律师的评价
	// 钱包
	vm.$u.api.getBalanceInfo = (params = {}) => vm.$u.get('api/lawyer.Balance/getBalanceInfo', params); // 获取钱包信息
	vm.$u.api.getBalanceChangeList = (params = {}) => vm.$u.get('api/lawyer.Balance/getBalanceChangeList', params); // 获取金额变更记录
	vm.$u.api.getOutMoneyDataList = (params = {}) => vm.$u.get('api/lawyer.Balance/getWithdrawList', params); // 获取提现记录
	vm.$u.api.nowOutMoney = (params = {}) => vm.$u.post('api/lawyer.Balance/createWithdraw', params); // 发起提现
	vm.$u.api.getProfileDatas = (params = {}) => vm.$u.get('api/lawyer.Lawyer/getProfile', params); // 获取个人提现账户资料
	vm.$u.api.editProfileDatas = (params = {}) => vm.$u.post('api/lawyer.Lawyer/editProfile', params); // 修改个人提现账户资料
	vm.$u.api.getBankList = (params = {}) => vm.$u.post('/api/lawyer.Balance/getBankList', params); // 获取银行卡开户行数据列表
	vm.$u.api.getInviteList = (params) => vm.$u.get('api/lawyer.Balance/getInviteList', params); // 获取今日推荐/总推荐/律师入驻相关信息
	// 获取个人资料
	vm.$u.api.getLawyerInfo = (params) => vm.$u.get('api/lawyer.Lawyer/getLawyerInfo', params); // 获取个人资料
	vm.$u.api.getLawyerScoreChangeList = (params) => vm.$u.get('api/lawyer.Lawyer/getLawyerScoreChangeList', params); // 获取积分变更记录(包含总积分)
	
	// 功能区接口
	vm.$u.api.getSwiperList = (params = {}) => vm.$u.get('api/common/getPhoto', params); // 获取律师端轮播图
	vm.$u.api.getToDoList = (params) => vm.$u.get('api/lawyer.Lawyercause/getHoldCourtList', params); // 获取开庭列表
	vm.$u.api.getLawCaseList = (params) => vm.$u.get('api/lawyer.Lawyercause/getLawCaseList', params); // 获取自己案件列表
	vm.$u.api.addLawCaseItem = (params) => vm.$u.post('api/lawyer.Lawyercause/createLawCase', params); // 创建案件
	vm.$u.api.getLawyerCauseIdentify = (params) => vm.$u.get('api/lawyer.Lawyercause/getLawyerCauseIdentify', params); // 获取原告/被告可选身份数据列表
	vm.$u.api.getLawyerCauseDataList = (params) => vm.$u.get('api/lawyer.Lawyercause/getLawyerCause', params); // 获取案由数据列表
	vm.$u.api.getLawyerCauseTrial = (params) => vm.$u.get('api/lawyer.Lawyercause/getLawyerCauseTrial', params); // 获取庭审阶段数据列表
	vm.$u.api.createHoldCourt = (params) => vm.$u.post('api/lawyer.Lawyercause/createHoldCourt', params); // 创建待开庭
	vm.$u.api.getHoldCourtItem = (params) => vm.$u.get('api/lawyer.Lawyercause/getHoldCourtDetail', params); // 获取开庭详情
	vm.$u.api.editHoldCourtItem = (params) => vm.$u.post('api/lawyer.Lawyercause/editHoldCourt', params); // 编辑待开庭
	vm.$u.api.delHoldCourtItem = (params) => vm.$u.post('api/lawyer.Lawyercause/delHoldCourt', params); // 删除一个开庭
	vm.$u.api.getTodoListDatas = (params) => vm.$u.get('api/lawyer.Lawyercause/getTodoList', params); // 获取待办事项列表
	vm.$u.api.addTodoListItem = (params) => vm.$u.post('api/lawyer.Lawyercause/createTodo', params); // 添加待办事项
	vm.$u.api.getTodoListItem = (params) => vm.$u.get('api/lawyer.Lawyercause/getTodoDetail', params); // 获取待办事项详情
	vm.$u.api.editTodoListItem = (params) => vm.$u.post('api/lawyer.Lawyercause/editTodo', params); // 编辑一个待办事项
	vm.$u.api.delTodoListItem = (params) => vm.$u.post('api/lawyer.Lawyercause/delTodo', params); // 删除一个待办事项
	
	vm.$u.api.SearchGetCaseList = (params) => vm.$u.get('/api/lawyer.Post/getCaseList', params); // 搜案例——获取案例列表
	vm.$u.api.SearchGetCaseItem = (params) => vm.$u.get('/api/lawyer.Post/getCaseContent', params); // 搜案例——获取案例详情
	
	// 案件
	vm.$u.api.getLawCaseDetail = (params) => vm.$u.get('api/lawyer.Lawyercause/getLawCaseDetail', params); // 查看自己的一个案子
	// 我的日志
	vm.$u.api.getJournalCategory = (params = {}) => vm.$u.get('api/lawyer.journal/getJournalCategory', params); // 律师端-获取日志分类列表
	vm.$u.api.addJournal = (params) => vm.$u.post('/api/lawyer.journal/addJournal', params); // 律师端-添加日志
	vm.$u.api.getJournalList = (params) => vm.$u.post('api/lawyer.journal/getJournalList', params); // 律师端-获取日志列表
	
	// 法律大全
	vm.$u.api.getLegalCategory = (params = {}) => vm.$u.get('/api/lawyer.Post/getLegalCategory', params); // 获取法律大全分类(无参)
	vm.$u.api.getLegalList = (params) => vm.$u.get('/api/lawyer.Post/getLegalList', params); // 获取法律大全列表
	vm.$u.api.getLegalContent = (params) => vm.$u.get('/api/lawyer.Post/getLegalContent', params); // 获取法律大全内容详情
	
	vm.$u.api.getCustomerList = (params) => vm.$u.get('api/lawyer.Lawyer/getCustomerList', params); // 获取客户管理列表
	vm.$u.api.addCustomer = (params) => vm.$u.post('api/lawyer.Lawyer/addCustomer', params); // 客户管理-添加客户
	
	// 下载文书
	vm.$u.api.getDocumentList = (params = {}) => vm.$u.post('api/user.doc/getList', params); // 下载文书
	vm.$u.api.getDocumentItem = (params) => vm.$u.get('api/user.doc/getDetail', params); // 获取文书详情
	
	// 意见反馈
	vm.$u.api.getFeedBackList = (params) => vm.$u.post('api/lawyer.Lawyer/getFeedback', params); // 获取意见反馈列表
	vm.$u.api.setFeedBackItem = (params) => vm.$u.post('api/lawyer.Lawyer/createFeedback', params); // 创建意见反馈
	
	
}

export default {
	install
}
